new Vue({
	el: "#app",
	data: {
		health: 100,
		isEnd: false
	},
	methods: {
		punch() {
			if (this.health >= 11) {
				this.health -= 10
				console.log(this.health)
			} else {
				this.health -= 10
				this.isEnd = true
				alert("进度条已经完成，请重新开始！")
			}

		},
		restart() {
			this.health = 100
			this.isEnd = false
			console.log(this.health)
		}
	}
})
